          <tr>
            <td>
<script type="text/javascript" language="javascript">
   var http_request = false;
   var myResponse = "Thank You!";
   
   function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}  
   
   function makePOSTRequest(url, parameters) {
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      
      http_request.onreadystatechange = alertContents;
      http_request.open('POST', url, true);
      http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      http_request.setRequestHeader("Content-length", parameters.length);
      http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);
   }

   function alertContents() {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            alert(http_request.responseText);
            result = http_request.responseText;
	    //document.getElementById('list_div').innerHTML = result;            
         } else {
	// uncomment for debugging
            // alert('There was a problem with the request.');
         }
      }
   }
   
   function list_post(obj) {
      var poststr = "list_firstname=" + encodeURI( document.getElementById("list_firstname").value ) +
                    "&list_lastname=" + encodeURI( document.getElementById("list_lastname").value ) +
		    "&list_email_add=" + encodeURI( document.getElementById("list_email_add").value ) +
		    "&list_check=" + encodeURI( document.getElementById("list_check").value ) +
		    "&list_on_off=" + getCheckedValue(document.forms['list_myform'].elements['list_on_off']);
		    // uncomment for debugging
		    //alert(poststr);
      makePOSTRequest('newsletterAJAX.php', poststr);
   }
</script>
<div id="list_div" name="list_div">
<?php
  $newsletter_boxContent = array();
  $newsletter_boxContent[] = array('align' => 'center',
  				'text' => '&nbsp;&nbsp;');

  new infoBoxHeading($newsletter_boxContent, true, true);
    $newsletter_boxContent = array();
    //$newsletter_boxContent[] = array('align' => 'center',
    	//			'text' => '<img src="images/infoBox/newsletter_top.png">');
	$newsletter_boxContent[] = array('align' => 'center',
				'text' => '<form action="javascript:list_post(document.getElementById(\'list_myform\'));" name="list_myform" id="list_myform">
				<input type="hidden" name="list_check" id="list_check" value="20">
				<input type=text name="list_firstname" id="list_firstname" value="First Name" style="margin:2px;width:100%;text-align:left;" onClick="this.value=\'\'";><br>
					<input type=text name="list_lastname" id="list_lastname" value="Last Name" style="margin:2px;width:100%;text-align:left;" onClick="this.value=\'\'";><br>
					<input type=text name="list_email_add" id="list_email_add" value="Email" style="margin:2px;width:100%;text-align:left;" onClick="this.value=\'\'";><br>');
	$newsletter_boxContent[] = array('align' => 'center',
				'text' => '<input type="radio" name="list_on_off" id="list_on_off" value=1 checked>Add
						<input type="radio" name="list_on_off" id="list_on_off" value=0>Remove
					<input type=submit value="Send" style="color:red;background-color:#ccc;">
					</form>');						
/*    if (tep_session_is_registered('customer_id')) {
   $newsletter_boxContent[] = array('align' => 'center',
   				'text' => 'Published bi-weekly full of Safety &amp; Preparedness tips, Limited Time Offers, etc:<br>
					<a href="' . tep_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'SSL') . '"><img src="images/button-subscribe.gif" width="75" height="14" border="0"></a>&nbsp;
					<a href="' . tep_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'SSL') . '"><img src="images/button-unsubscribe.gif" width="75" height="14" border="0"></a><br>');
     }
   else
   {
   $newsletter_boxContent[] = array('align' => 'center',
   				'text' => 'Published bi-weekly full of Safety &amp; Preparedness tips, Limited Time Offers, etc:<br>
					<a href="' . tep_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'SSL') . '"><img src="images/button-subscribe.gif" width="75" height="14" border="0"></a>&nbsp;
					<a href="' . tep_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'SSL') . '"><img src="images/button-unsubscribe.gif" width="75" height="14" border="0"></a><br>');
   } */


  new infoBox($newsletter_boxContent);
?>
</div>
            </td>
          </tr>
<!-- information_eof //-->

